-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add negative sizes as a prop pack #528
base: 2.0.0beta
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the use case for these? do they actually produce usable values?
curious if we should instead just
--size-fluid-1-: calc(var(--size-fluid-1) * -1);
this produces the inverted value too?
Are you questioning the point of negative fluid sizes specifically or all of them? Fluid is probably a more contrived situation but my thought process there was that With that said, there's no rush here. More code is more technical debt and once you release something it's hard to take it back. Regarding your proposition with calc though - it looks so much cleaner. Yes. |
yep, very true. however, I do need at least one or two use cases in order to verify the negative value strategy we go with, is actually useful. like here, you show not just inverting values, but inverting the parameters: --size-fluid-1: clamp(0.5rem, 1vw, 1rem); /* positive */
--size-fluid-1-: clamp(-1rem, -1vi, -0.5rem); /* negative */ that's interesting! and here I suggest inverting the result of the value it's a compliment for: --size-fluid-1-: calc(var(--size-fluid-1) * -1); 🤷🏻 I don't think these two strategies produce the same values in all situations, and I don't know which one is right. I think we need to know what we're solving for, to make sure these vars behave like we want them to. best idea I can come up with is some negative margin to offset the padding or margin of a container? |
Regardless of how interesting it could be to invert all values I think your inversion is more what you'd expect from a negative size-fluid - it's way more reasonable. The use-cases won't differ much between the two approaches as far as I can tell. This is a demo I made earlier and it's all negative margins and pull quotes and break out stuff. Can't think of cooler stuff than that 😅 I've added both approaches there just for a quick comparison. Pushed a new commit based on your |
Not sure if I nailed the naming of stuff, you might want to take a look at that.
Worth noting also is that I reversed the values in each clamp and switched to logical units, ie: